#!/bin/sh

. /etc/rc.subr

name="storageserver"
start_cmd="${name}_start"
stop_cmd=":"

storageserver_start()
{
    ip=$(ifconfig xn0 | grep inet | cut -f 2 -d " ")
    cd /root
    /usr/local/bin/python storage.py --ip-addr ${ip} --port 8080 --log /var/log/SMlog --daemon
    echo "storageserver started on ${ip}."
}

load_rc_config $name
run_rc_command "$1"
